Within the past decade, the advent of world-wide electronic communications systems has enhanced the way in which people can send and receive information. In particular, the capabilities of real-time video and audio systems have greatly improved in recent years. In order to provide services such as video-on-demand and video conferencing to subscribers, an enormous amount of network bandwidth is required. In fact, network bandwidth is often the main inhibitor in the effectiveness of such systems.
In order to overcome the constraints imposed by networks, compression systems have emerged. These systems reduce the amount of video and audio data which must be transmitted by removing redundancy in the picture sequence. At the receiving end, the picture sequence is uncompressed and may be displayed in real-time.
One example of an emerging video compression standard is the Moving Picture Experts Group ("MPEG") standard. Within the MPEG standard, video compression is defined both within a given picture and between pictures. Video compression within a picture is accomplished by conversion of the digital image from the time domain to the frequency domain by a discrete cosine transform, quantization, variable length coding, and Huffman coding. Video compression between pictures is accomplished via a process referred to as motion estimation, in which a motion vector plus difference data is used to describe the translation of a set of picture elements (pels) from one picture to another.
The ISO MPEG2 standard specifies only the syntax of bitstream and semantics of the decoding process. The choice of coding parameters and tradeoffs in performance versus complexity are left to the encoder developers.
One aspect of the MPEG2 compliant encoding process is compressing a digital video image into as small a bitstream as possible while still maintaining video detail and quality. The MPEG standard places limitations on the size of the bitstream, and requires that the encoder be able to perform the encoding process. Thus, simply optimizing the bit rate to maintain desired picture quality and detail can be difficult. For example, the MPEG standard requires that no more than two macroblocks in each horizontal row of a picture exceed the bit rate limitation, which for a 4:2:0 format is 4608 bits. In the case of scene changes and action videos, the bit rate can be quickly consumed with drastic changes between frames. Picture quality and detail can suffer as a result.
Another aspect of the MPEG2 compliant encoding process is a performance issue arising at the compressed store interface with encoding of nonintra macroblocks. This issue stems from the fact that the coded block pattern, which is part of the macroblock header and required by MPEG standard, cannot be determined until after all quantized coefficients of a macroblock are variable-length encoded. While waiting for the coded block pattern, the compressed store interface must buffer the coefficients to ensure that the macroblock header for the current macroblock is multiplexed into the compressed bitstream before the encoded coefficients to be output from the encoder. Again, this is needed to comply with the MPEG standard. Intra macroblocks do not require coefficients to be buffered because intra macroblocks necessarily contain data and thus do not have coded block patterns. The amount of encoded coefficient data in a nonintra macroblock will affect encoder performance because of the time needed to read the data from the buffer and multiplex it into the compressed bitstream.
The present invention presents macroblock bit regulation schemes for the video encoder which address the above-summarized problems inherent in the standard quantitization, variable length encoding and compressed store interface processings.